import request from '@u/request'
import { header } from '@/api/project-update/tempHeader'

// const gateway = '/project'
const gateway = '/project'
// const gateway = 'http://localhost:8080/city/local'

export function getProjectInventoryList(params) {
  return request({
    url: `${gateway}/project/selectProjectList`,
    method: 'post',
    data: params,
    headers: { ...header },
  })
}

export function getProjectInventoryDetail(id) {
  return request({
    url: `${gateway}/project/selectProject/${id}`,
    method: 'get',
    headers: { ...header },
  })
}

export function addProjectInventory(data, params = {}) {
  return request({
    url: `${gateway}/project/insertProject`,
    method: 'post',
    data: data,
    params,
    headers: { ...header },
  })
}

export function updateProjectInventory(data, params = {}) {
  return request({
    url: `${gateway}/project/updateProject`,
    method: 'put',
    data: data,
    params,
    headers: { ...header },
  })
}

export function updatePeStage(data, params = {}) {
  return request({
    url: `${gateway}/project/updatePeStage`,
    method: 'put',
    data: data,
    params,
    headers: { ...header },
  })
}

export function updateProject(data, params = {}) {
  return request({
    url: `${gateway}/project/update/project`,
    method: 'put',
    data: data,
    params,
    headers: { ...header },
  })
}

export function deleteProjectInventory(id) {
  return request({
    url: `${gateway}/project/deleteProject/${id}`,
    method: 'delete',
    headers: { ...header },
  })
}
